var app = getApp();
import { showActionSheet } from '../../utils/camera.js';
Page({
    data: {
        main:0,
        tabs: [{ "name": "最新", "type": 'new' }, { "name": "最热", "type": "hot" }],
        activeIndex:0,
        tabBar:[{ "name": "留言板",'icon':'/images/liu.png','url':'../home/home','selectIcon':'/images/mine.png' },{ "name": "我的",'icon':'/images/mine.png','url':'../mine/mine','selectIcon':'/images/liu.png' }],
        moveIndex:0,
        start:false,
        newList:[],
        info:{},
        hotList:[],
        activeList:[],
        activeImg:null,
        ineedmt:0,
        flag:false,
    },
  onReady:function(){
      var that=this
      var value=wx.getStorageSync('userInfo')
      that.setData({
          info:value
      })
    //   app.showToast()
      this.getBrandInfo()
  },
  getBrandInfo:function(e){
    var self=this
    // app.showToast()
    var brand=wx.getStorageSync('brandId')
    wx.request({
        url: 'https://www.hibigpc.com/getBrandInfo',
        data: {
            brandId:brand
        },
        header: {
            'content-type': 'application/x-www-form-urlencoded'
        },
        success: function(res) {
            console.log(res.data)
            var brandList=res.data.dataWrapper.tbBrand.resultList
            self.setData({
                activeList:brandList
            })
        }
    }) 
  },
  onReachBottom:function(){
    var self=this
    wx.redirectTo({
        url: '/pages/home/home',
    })
  },
  onShareAppMessage: function () {
        var brandId=wx.getStorageSync('brandId')
        return {
        title: '到此一玩小程序',
        path: '/pages/home/home?brandId='+brandId,
        success: function(res) {
            // 分享成功
        },
        fail: function(res) {
            // 分享失败
        }
        }
    }
}) 